package fr.aprr.geoloc.shared.domain;

// default package
// Generated Apr 23, 2014 11:01:50 PM by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ChangeAutoroute generated by hbm2java
 */
@Entity
@Table(name = "ody$conf_change_autoroute", schema = "public")
public class ChangeAutoroute implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ChangeAutorouteId id;
	private Autoroute autorouteByAutorouteDepart;
	private Autoroute autorouteByAutorouteArrive;

	public ChangeAutoroute() {
	}

	public ChangeAutoroute(ChangeAutorouteId id) {
		this.id = id;
	}

	public ChangeAutoroute(ChangeAutorouteId id,
			Autoroute autorouteByAutorouteDepart,
			Autoroute autorouteByAutorouteArrive) {
		this.id = id;
		this.autorouteByAutorouteDepart = autorouteByAutorouteDepart;
		this.autorouteByAutorouteArrive = autorouteByAutorouteArrive;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "autorouteDepart", column = @Column(name = "autoroute_depart", length = 8)),
			@AttributeOverride(name = "sensDepart", column = @Column(name = "sens_depart", nullable = false, length = 6)),
			@AttributeOverride(name = "pkDepart", column = @Column(name = "pk_depart", nullable = false, precision = 8, scale = 8)),
			@AttributeOverride(name = "autorouteArrive", column = @Column(name = "autoroute_arrive", length = 8)),
			@AttributeOverride(name = "pkArriveS1", column = @Column(name = "pk_arrive_s1", nullable = false, precision = 8, scale = 8)),
			@AttributeOverride(name = "tempS1", column = @Column(name = "temp_s1")),
			@AttributeOverride(name = "pkArriveS2", column = @Column(name = "pk_arrive_s2", nullable = false, precision = 8, scale = 8)),
			@AttributeOverride(name = "tempS2", column = @Column(name = "temp_s2")) })
	public ChangeAutorouteId getId() {
		return this.id;
	}

	public void setId(ChangeAutorouteId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "autoroute_depart", insertable = false, updatable = false)
	public Autoroute getAutorouteByAutorouteDepart() {
		return this.autorouteByAutorouteDepart;
	}

	public void setAutorouteByAutorouteDepart(
			Autoroute autorouteByAutorouteDepart) {
		this.autorouteByAutorouteDepart = autorouteByAutorouteDepart;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "autoroute_arrive", insertable = false, updatable = false)
	public Autoroute getAutorouteByAutorouteArrive() {
		return this.autorouteByAutorouteArrive;
	}

	public void setAutorouteByAutorouteArrive(
			Autoroute autorouteByAutorouteArrive) {
		this.autorouteByAutorouteArrive = autorouteByAutorouteArrive;
	}

}
